package library.persistence.service;

import library.domain.User;
import library.persistence.impl.AccountDaoImpl;

public class AccountService {

    public User getAccount(String username){
        return new AccountDaoImpl().getAccountByUsername(username);
    }

    public User getAccount(String username,String password){
        return new AccountDaoImpl().getAccountByUsernameAndPassword(username,password);
    }

    public void insertAccount(User user){
        new AccountDaoImpl().insertAccount(user);
    }

    public void updateAccount(User user){
        new AccountDaoImpl().updateAccount(user);
    }

//    public static void main(String[] args) {
//        AccountService accountService = new AccountService();
//        User user = new User("张三","123456","8209210200",0);
//        User user1 = accountService.getAccount(user.getUsername(),user.getPassword());
//        System.out.println(user1.getUsername());
//    }

}
